import App from './App'
import { createSSRApp } from 'vue'
import {i18n,getLang} from './locale/index'

//把表单字段组件注册到全局，解决跨平台兼容的容器组件循环引用问题
import WFormItem from '@/components/WFormItem.vue'

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  i18n,
  ...App
})
app.$mount()
// #endif

export function createApp() {
  const app = createSSRApp(App)
  app.use(i18n)
  app.config.globalProperties.$getLang = getLang
  app.component('WFormItem', WFormItem)
  return {
    app
  }
}